# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Aiden Grossman <agrossman154@yahoo.com>
pkgname=libarcus
# Needs to be upgraded in sync with the curaengine aport
pkgver=4.13.1
pkgrel=1
pkgdesc="Communication library for Cura"
url="https://github.com/Ultimaker/libArcus"
arch="all"
license="LGPL-3.0-or-later"
makedepends="
	cmake
	protobuf-dev
	py3-sip4-dev
	python3-dev
	"
subpackages="$pkgname-dev py3-$pkgname:_py"
options="!check" # no test suite
source="https://github.com/Ultimaker/libArcus/archive/$pkgver/libArcus-$pkgver.tar.gz
	protobuf.patch
	"
builddir="$srcdir/libArcus-$pkgver"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_PYTHON=ON
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

_py() {
	pkgdesc="Python bindings for libarcus"
	depends="python3"
	amove usr/lib/python3*
}

sha512sums="
ffb14595f23c47f71082b994eae01471f45e2e9e1ae9a8ad01df577b9445594c30173388beab016a92be9723638ca6e46b5cecddddc6adc97e9d212fc0fa23fa  libArcus-4.13.1.tar.gz
6b1994507776148a07f8adfa56590259bd6142a780c7660ed7b1c007f79a9399a0914565b66e9422597ae052f0988c3ae09a20f096902f3a9e2daee20c42d363  protobuf.patch
"
